﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using mealplanner.database;

namespace mealplanner.control
{
    class Normal : Meal
    {
        /// <summary>
        /// get all healthy meal from database 
        /// </summary>
        /// <returns> return list of healthy meal </returns>
        public ArrayList getHealthyMeal()
        {
            ArrayList mealList = new ArrayList();
            ArrayList healthyList = new ArrayList();
            double colorie;
            mealList = MealDB.getAllMealNameAndType();
            for (int i = 0; i < mealList.Count; i++)
            {

                string mealName = mealList[i++].ToString();
                colorie = CaluclateCalories(mealName);
                if (colorie >= 1 && colorie <= 100)
                    healthyList.Add(mealName);
            }

            return healthyList;
        }
    }
}
